﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Torch_IRepository
{
    public interface IBaseDal<T> where T : class, new()
    {
        //新增
        Task<int> AddAsync(T entity, bool isSaved = true);

        //修改
        Task<int> EditAsync(T entity, bool isSaved = true);

        //删除
        Task<int> DeleteAsync(T entity, bool isSaved = true);

        //执行保存
        Task<int> SaveDataAsync();

        //全查询
        Task<List<T>> QueryAsync();

        //条件查询
        Task<List<T>> QueryAsync(Expression<Func<T, bool>> whereLambda);

        //编号查询
        Task<T> QueryAsync(int id);


    }
}
